Exploring Estuaries in the Florida Coastal Everglades
Courtesy of the FCE LTER
In my infographic, I chose to explore a subset of nutrients that are the most essential for plant growth and the sites’ geographical locations. This is because the data was not categorized in terms of water quality standards prior to downloading. I was curious to discover roughly what percentage of these estuaries had experienced nutrient deficiencies and if there were any regional trends that may be of interest to explore in depth later. I was also curious what the nutrient disparities of Oliogotrophic sites looked liked compared to Mesotrophic sites. For these reasons I selected a waffle chart, a map, and a dumbbell plot to answer my questions. I wanted the colors of the sites to represent the color-blind friendly colors associated with water bodies assigned those water quality classifications. Oligotrophic areas have less plant growth, so the waters are bluer compared to greener mesotrophic areas with more plant growth.
I wanted to avoid information overload for my audience, so I really tried to limit the amount of text on my infographic. It seemed most important to explain why we’re interest in phosphorous, dig a little into what the water quality standards meant, and define how this data is applied to protect estuaries. So, I included these components into my infographic and allowed my audience the space to observe the relatively obvious trends displayed.
Expanding more on my stylistic choices, I wanted to simplify my infographic as much as possible. For this reason the dumbbell plot is the only visual with labels attached. I selected big, bolded, color-coded writing because this was the most complicated graph to interpret. There are seven variables being considered for two groups. I found stacking them and labeling them according to water nutrients instead of listing them on a y-axis was less noisy and easier to compare the different nutrients. Including a title and x axis explaining the dumbbell plot felt like the best decision for accessibility reasons. The colors applied in the title were choosen to match the entire color scheme of the infographic. Alt txt, captions, titles, and subtitles were included for all of the individual plots below. This is because I wanted my blog audience to have a full understanding of what each visual is representing.
What makes these estuaries so special and where are they located?
Upon some mapping, a concentration of Oligotrophic estuaries were observed in the western region of the FCE. Oligotrophic sites within the FCE exhibit a unique relationship between dissolved organics in mash estuaries and marine phosphorous. These sites’ dissolved organics are dependent on interactions with the ocean in order to acquire marine phosphorous1. This is very unusual and a unique attribute of the region. Typically, this interaction is in the opposite direction. For this reason, these locations are tokened as “upside-down” estuaries. Marine phosphorous is an essential component to facilitate plant and algal growth in these “upside-down” marshes. However, there are very limited amounts of total phosphorous present in these locations, restricting ecosystem development.
FCE Water Quality Standards
Relating precipitation and water management to nutrient concentrations in the oligotrophic “upside-down” estuaries of the Florida Everglades is the paper I utilized to categorize the FCE-LTER sites into Oligotrophic or Mesotrophic.
What are they key differences between the quality classifications?
Oligotrophic: Low water nutrients little to zero plant growth: Total Phosphorous < 0.025 (umol/L). These sites demonstrated higher total nitrogen concentrations and alkaline phosphatase activity. In all other water nutrient categories, sites classified as Oligotrophic had fewer nutrients.
Mesotrophic: Moderate water nutrients with some plant growth: Total Phosphorous > 0.025 (umol/L). For the majority of the water nutrient cateogries, sites classified as Mesotrophic had more nutrients.
If you’re curious to learn more, I recommend checking out the paper linked above! It contains detailed documentation explaining why the threshold for Oligotrophic sites is a total phosphorous concentration of 0.25 (μmol/L).
FCE LTER Data Collection
The Southeast Environmental Research Center (SERC) at Florida International University manages a network of 331 fixed sampling sites spread throughout the estuarine and coastal ecosystems of southern Florida. Surveying began in June of 1989: Biscayne Bay, Florida Bay, Whitewater Bay, Ten Thousand Islands, Rookery Bay, Estero Bay, and Pine Island Sound are sampled monthly. The Florida Keys National Marine Sanctuary (FKNMS) and the southwest shelf are sampled quarterly.
The objective of this long-term monitoring project is to aid in determinating if conditions within these estuaries and sanctuaries are improving or declining. FCE-LTER’s data is intended to provide stakeholders the necessary information to achieve the goals established by the south Florida marine resource restoration and protection effort. These observations are used to establish baseline reference conditions for development of resource-based water quality standards.
There is curiosity around what are the key drivers of these “upside-down” estuaries. Currently, three hypothesis are under consideration at the FCE-LTER:
1: In nutrient-poor coastal systems, long-term changes in the quantity or quality of organic matter inputs will exert strong and direct controls on estuarine productivity, because inorganic nutrients are at such low levels.
2: Interannual and long-term changes in freshwater flow controls the magnitude of nutrients and organic matter inputs to the estuarine zone, while ecological processes in the freshwater marsh and coastal ocean control the quality and characteristics of those inputs.
3: Long-term changes in freshwater flow (primarily manifest through management and Everglades restoration) will interact with long-term changes in the climatic and disturbance (sea level rise, hurricanes, fires) regimes to modify ecological pattern and process across coastal landscapes.
Visualizing the Data
The following code is a walk through of how I developed the three visualizations included in the infographic created in Canva above. I would like to note that this is an early rendition of this infographic. I plan on expanding this personal project to investigate the water management district boundaries and evaluate the different types policies in place, or lack there of, that could be potential drivers of lower nutrient levels in estuaries.
Set up
Code
# set default chunk options
knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
library(sf)
library(tmap)
library(here)
library(waffle)
library(ggtext)
library(metajam)
library(leaflet)
library(cowplot)
library(showtext)
library(patchwork)
library(tidyverse)
library(tmaptools)Load & clean data from DataONE
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## import data ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- Store the filepath to use later :-) This helps us easily call our data set. ----
url <- "https://cn.dataone.org/cn/v2/resolve/https%3A%2F%2Fpasta.lternet.edu%2Fpackage%2Fdata%2Feml%2Fknb-lter-fce%2F1055%2F13%2F9a61989893f4da76c0a7558a867af50d"
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- download data from DataOne ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# pull from DataONE and store in data folder
#download_d1_data(url,
# path = here::here("posts","data"))
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- read in downloaded files. ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# read in data scrapped
data_files <- read_d1_files(here::here("posts","data", 'https_pasta.lternet.edu_package_metadata_eml_knb-lter-fce_1055_13__LT_ND_Boyer_001__csv'),
show_col_types = FALSE)
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- select data as subset ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# subset for raw data
raw_data <- data_files[4] %>%
as.data.frame(show_col_types = FALSE)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- clean data ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# assigning -9999 as NA values
raw_data[ raw_data == c(-9999, -9999.0, -9999.00, -9999.000) ] <- NA
# cleaning df
clean_data <- raw_data %>%
janitor::clean_names()
# sub in base R to remove "data" from the beginning of the column names
names(clean_data) <- sub('^data', '', names(clean_data))
# sub in base R to remove "_" from the beginning of the column names
names(clean_data) <- sub('^_', '', names(clean_data))
# assign water quality status using total phosphorous column
clean_data <- clean_data %>%
mutate(eutrophic_status = case_when(
na.omit((tp < 0.25) ~ "Oligotrophic"),
na.omit((tp >= 0.25) ~ "Mesotrophic")
)
)Wrangling & Subsetting
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## subset site wq data ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- wq status subset ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# subset oligo sites water nutrients
oligo_sites <- clean_data %>%
filter(eutrophic_status %in% "Oligotrophic") %>%
select(site, din, srp, apa, ton, si_o2, toc, tp, eutrophic_status, latdec, londec) %>%
na.omit()
# subset meso sites water nutrients
meso_sites <- clean_data %>%
filter(eutrophic_status %in% "Mesotrophic") %>%
select(site, din, srp, apa, ton, si_o2, toc, tp, eutrophic_status, latdec, londec) %>%
na.omit()Map Data
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## data for mapping ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- combo sites for mapping ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# sf object of combined site wq info
fce_surveying_sites <- bind_rows(oligo_sites, meso_sites) %>%
group_by(eutrophic_status) %>%
st_as_sf(coords = c('londec','latdec')) %>%
mutate('Water Quality Status' = eutrophic_status)
# set CRS
fce_sites_shp <- st_crs(fce_surveying_sites, 4326)Waffle Data
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## data for waffle plot ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- combo sites count comparison ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
combo_sites <- bind_rows(oligo_sites, meso_sites) %>%
group_by(eutrophic_status) %>%
# Count the number of sites for each category
summarise(n = n())Dumbbell Data
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## data for dumbbell plot ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- avg wq status nutrients ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# summarize across all sites for plotting
oligo_sum <- oligo_sites %>%
summarize(
avg_tp = round(mean(tp), 3),
avg_din = round(mean(din), 3),
avg_srp = round(mean(srp), 3),
avg_apa = round(mean(apa), 3),
avg_ton = round(mean(ton), 3),
avg_si_o2 = round(mean(si_o2), 3),
avg_toc = round(mean(toc), 3)
)
# summarize across all sites for plotting
meso_sum <- meso_sites %>%
summarize(
avg_tp = round(mean(tp), 3),
avg_din = round(mean(din), 3),
avg_srp = round(mean(srp), 3),
avg_apa = round(mean(apa), 3),
avg_ton = round(mean(ton), 3),
avg_si_o2 = round(mean(si_o2), 3),
avg_toc = round(mean(toc), 3)
)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- smallest avg wq status nutrients ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# summarize across all sites for plotting
oligo_sum_small <- oligo_sites %>%
summarize(
avg_tp = round(mean(tp), 3),
avg_srp = round(mean(srp), 3),
avg_apa = round(mean(apa), 3),
)
# summarize across all sites for plotting
meso_sum_small <- meso_sites %>%
summarize(
avg_tp = round(mean(tp), 3),
avg_srp = round(mean(srp), 3),
avg_apa = round(mean(apa), 3),
)
# combine into a single df and assign wq status & nutrient to each observation
combo_avg_small <- bind_rows(oligo_sum_small, meso_sum_small,
.id = "category") %>%
pivot_longer(-category, names_to = "nutrient",
values_to = "Average") %>%
mutate(nutrient = gsub("avg_", "", nutrient),
category = factor(category,
levels = c("1", "2"),
labels = c("Oligotrophic", "Mesotrophic")))
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- medium avg wq status nutrients ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# summarize across all sites for plotting
oligo_sum_med <- oligo_sites %>%
summarize(
avg_din = round(mean(din), 3)
)
# summarize across all sites for plotting
meso_sum_med <- meso_sites %>%
summarize(
avg_din = round(mean(din), 3)
)
# combine into a single df and assign wq status & nutrient to each observation
combo_avg_med <- bind_rows(oligo_sum_med, meso_sum_med,
.id = "category") %>%
pivot_longer(-category, names_to = "nutrient",
values_to = "Average") %>%
mutate(nutrient = gsub("avg_", "", nutrient),
category = factor(category,
levels = c("1", "2"),
labels = c("Oligotrophic", "Mesotrophic")))
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- big avg wq status nutrients ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# summarize across all sites for plotting
oligo_sum_big <- oligo_sites %>%
summarize(
avg_ton = round(mean(ton), 3),
avg_si_o2 = round(mean(si_o2), 3)
)
# summarize across all sites for plotting
meso_sum_big <- meso_sites %>%
summarize(
avg_ton = round(mean(ton), 3),
avg_si_o2 = round(mean(si_o2), 3)
)
# combine into a single df and assign wq status & nutrient to each observation
combo_avg_big <- bind_rows(oligo_sum_big, meso_sum_big,
.id = "category") %>%
pivot_longer(-category, names_to = "nutrient",
values_to = "Average") %>%
mutate(nutrient = gsub("avg_", "", nutrient),
category = factor(category,
levels = c("1", "2"),
labels = c("Oligotrophic", "Mesotrophic")))
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- biggest avg wq status nutrients ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# summarize across all sites for plotting
oligo_sum_bige <- oligo_sites %>%
summarize(
avg_toc = round(mean(toc), 3)
)
# summarize for plotting
meso_sum_bige <- meso_sites %>%
summarize(
avg_toc = round(mean(toc), 3)
)
# combine into a single df and assign wq status & nutrient to each observation
combo_avg_bige <- bind_rows(oligo_sum_bige, meso_sum_bige,
.id = "category") %>%
pivot_longer(-category, names_to = "nutrient",
values_to = "Average") %>%
mutate(nutrient = gsub("avg_", "", nutrient),
category = factor(category,
levels = c("1", "2"),
labels = c("Oligotrophic", "Mesotrophic")))Customs
Text
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- create plot labels ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- map labels ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
m_title <- "LTER Surveying Sites in the Florida Coastal Everglades"
m_subtitle <- "Identifying <span style='color:#34A0A4;'>**Oligotrophic**</span> Estuaries"
m_legend <- "Water Quality Status"
m_alt <- "This is a map of Florida, highlighting the LTER water quality surveying sites located in the Florida Coastal Everglades. The sites are categorized into two groups: Oligotrophic (blue points) and Mesotrophic (green points). The cluster of Oligotrophic sites are observed in the western portion of the surveying area. Sites categorized as Oligotrophic contain low water nutrients, with zero to little plant growth. The total phosphorous content is < 0.025 (μmol/L). Sites categorized as Mesotrophic contain greater concentrations of total phosphorous, moderate water nutrients, and have some plant growth."
m_caption <- "Source: Henry Briceno. (2023). Surface Water Quality Monitoring Data (FCE LTER), \nFlorida, USA, June 1989-ongoing"
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- waffle labels ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
w_title <- "Proportions of FCE Estuaries Identified as <span style='color:#34A0A4;'>**Oligotrophic**</span>"
w_subtitle <- "LTER Florida Coastal Everglades"
w_legend <- "Water Quality Status"
w_alt <- "This is a waffle chart of the proportion of water quality status across the LTER surveying sites located in the Florida Coastal Everglades. There is a signficantly larger portion of Mesotrophic sites. Roughly 70% total are classified as Mesotrophic. The sites are categorized into two groups: Oligotrophic (blue points) and Mesotrophic (green points). Sites categorized as Oligotrophic contain low water nutrients, with zero to little plant growth. The total phosphorous content is < 0.025 (μmol/L). Sites categorized as Mesotrophic contain greater concentrations of total phosphorous, moderate water nutrients, and have some plant growth."
w_caption <- "Source: Henry Briceno. (2023). Surface Water Quality Monitoring Data (FCE LTER), \nFlorida, USA, June 1989-ongoing"
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- dumbbell labels ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
d_title <- "<span style='color:#3B1608;'>**Investigating Water Nutrient Trends in**</span> <span style='color:#34A0A4;'>**Oligotrophic**</span> and <span style='color:#AACC00;'>**Mesotrophic**</span> <span style='color:#3B1608;'>**Estuaries**</span>"
#"Investigating Water Nutrients (umol/L) in <span style='color:#34A0A4;'>**Oligotrophic**</span> and <span style='color:#AACC00;'>**Mesotrophic**</span>"
d_subtitle <- "LTER Surveying Sites in the Florida Coastal Everglades"
d_alt <- "This is a dumbbell plot comparing the average water nutrient levels of Oligotrophic and Mesotrophic sites. This data is taken from the LTER water quality surveying sites located in the Florida Coastal Everglades. The sites are categorized into two groups: Oligotrophic (blue points) and Mesotrophic (green points). Sites categorized as Oligotrophic contain low water nutrients, with zero to little plant growth. The total phosphorous content is < 0.025 (μmol/L).These sites demonstrated higher total nitrogen concentrations and alkaline phosphatase activity. In all other water nutrient categories, sites classified as Oligotrophic had fewer nutrients. Sites categorized as Mesotrophic contain greater concentrations of total phosphorous, moderate water nutrients, and have some plant growth."
d_caption <- "Source: Henry Briceno. (2023). Surface Water Quality Monitoring Data (FCE LTER), \nFlorida, USA, June 1989-ongoing"Colors & Typeface
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- plot customizations ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- wq status palette ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# water quality status palette
status_pal <- c("Oligotrophic" = "#34A0A4", "Mesotrophic" = "#AACC00")
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ---- fonts ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# enable {showtext} for rendering
showtext_auto()
# import fonts
font_add_google(name = "Josefin Sans", family = "josefin")
font_add_google(name = "Sen", family = "sen")Map of LTER Surveying Sites in the FCE
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## map sites ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bbox_florida <- st_bbox(c(xmin = -87.6347, ymin = 24.3963, xmax = -79.9743, ymax = 31.001))
tmap_mode('plot')
map <- tm_shape(fce_surveying_sites, bbox = bbox_florida) +
tm_basemap(leaflet::providers$Esri.WorldImagery) +
tm_bubbles(col = 'Water Quality Status',
palette = status_pal,
legend.title = m_legend
) +
tm_scalebar(position = c('left', 'bottom')) +
tm_layout(
alt.text = m_alt,
main.title = m_title,
subtitle = m_subtitle,
caption = m_caption,
main.title.position = "center",
main.title.size = 19,
# match my website colors
main.title.color = "#293F2C",
main.title.fontface = "Josefin Sans",
main.title.fontfamily = "josefin",
# match my website colors
bg.color = "#FDFBF7",
outer.bg.color = "#FDFBF7"
)
mapWaffle Chart
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## waffle sites ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ggplot(combo_sites, aes(fill = eutrophic_status,
values = n)) +
geom_waffle(color = "white",
size = 0.3,
n_rows = 10,
make_proportional = TRUE,
flip = TRUE
) +
labs(title = w_title,
subtitle = w_subtitle,
caption = w_caption,
alt = w_alt) +
coord_equal() +
scale_fill_manual(values = status_pal) +
theme_void() +
theme(
plot.title = element_markdown(family = "josefin",
face = "bold",
size = 14,
hjust = 0.5,
vjust = 6),
plot.subtitle = element_text(family = "sen",
size = 12,
hjust = 0.5),
plot.caption = element_text(family = "sen",
size = 9,
hjust = 0.5,
vjust = -0.9),
legend.position = "bottom",
legend.title = element_blank(),
# legend text customs
legend.text = element_text(family = "josefin",
size = 12),
# match my website colors
plot.background = element_rect(color = '#FDFBF7',
fill = '#FDFBF7'),
# space on the side of the plot
plot.margin = margin(t = 1, r = 1, b = 1, l = 1, "cm")
) Dumbbell Plot
Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## build dumbbell pieces ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- smallest avg wq status nutrients ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
small_dumb <- ggplot(combo_avg_small,
aes(x = Average,
y = nutrient,
color = category)) +
geom_point(size = 6) +
# Draw lines between points
geom_line(aes(group = nutrient),
linewidth = 2) +
scale_color_manual(values = c("Oligotrophic" = "#34A0A4", "Mesotrophic" = "#AACC00")) +
labs(title ="Total Phosphorous, Soluble Reactive Phosphorous, & Alkaline Phosphatase Activity",
x = "Water Nutrients μmol/L",
color = "Site Type") +
theme_classic() +
theme(plot.title = element_text(family = "josefin",
face = "bold",
size = 15,
color = '#3B1608',
hjust = 0.5,
vjust = 0.5),
legend.position = 'none',
axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.text.x = element_text(family = "josefin",
face = "bold",
size = 12,
color = '#3B1608',
angle = 0,
vjust = 0.8),
axis.title.x = element_blank(),
margin(t = 2,
r = 0,
b = 1,
l = 2),
axis.ticks.y = element_blank(),
panel.border = element_blank(),
axis.line.y = element_blank()
)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- medium avg wq status nutrients ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
med_dumb <- ggplot(combo_avg_med,
aes(x = Average,
y = nutrient,
color = category)) +
geom_point(size = 6) +
# Draw lines between points
geom_line(aes(group = nutrient),
linewidth = 2) +
scale_color_manual(values = c("Oligotrophic" = "#34A0A4", "Mesotrophic" = "#AACC00")) +
labs(title = "Dissolved Inorganic Nitrogen",
x = "Water Nutrients μmol/L",
color = "Site Type") +
theme_classic() +
theme(plot.title = element_text(family = "josefin",
face = "bold",
size = 15,
color = '#3B1608',
hjust = 0.5,
vjust = 0.5),
legend.position = 'none',
axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.text.x = element_text(family = "josefin",
face = "bold",
size = 12,
color = '#3B1608',
angle = 0,
vjust = 0.8),
axis.title.x = element_blank(),
margin(t = 2,
r = 0,
b = 1,
l = 2),
axis.ticks.y = element_blank(),
panel.border = element_blank(),
axis.line.y = element_blank()
)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- big avg wq status nutrients ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
big_dumb <- ggplot(combo_avg_big,
aes(x = Average,
y = nutrient,
color = category)) +
geom_point(size = 6) +
# Draw lines between points
geom_line(aes(group = nutrient),
linewidth = 2) +
scale_color_manual(values = c("Oligotrophic" = "#34A0A4", "Mesotrophic" = "#AACC00")) +
labs(title = "Total Organic Nitrogen & Silicon Dioxide in Water",
x = "Water Nutrients μmol/L",
color = "Site Type") +
theme_classic() +
theme(plot.title = element_text(family = "josefin",
face = "bold",
size = 15,
color = '#3B1608',
hjust = 0.5,
vjust = 0.5),
legend.position = 'none',
axis.title.y = element_blank(),
axis.text.y = element_blank(),
axis.text.x = element_text(family = "josefin",
face = "bold",
size = 12,
color = '#3B1608',
angle = 0,
vjust = 0.8),
axis.title.x = element_blank(),
margin(t = 2,
r = 0,
b = 1,
l = 2),
axis.ticks.y = element_blank(),
panel.border = element_blank(),
axis.line.y = element_blank()
)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- biggest avg wq status nutrients ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bige_dumb <- ggplot(combo_avg_bige,
aes(x = Average,
y = nutrient,
color = category)) +
geom_point(size = 6) +
# Draw lines between points
geom_line(aes(group = nutrient),
linewidth = 2) +
scale_color_manual(values = c("Oligotrophic" = "#34A0A4", "Mesotrophic" = "#AACC00")) +
labs(title = "Total Organic Carbon",
x = "Water Nutrients μmol/L",
color = "Site Type") +
theme_classic() +
theme(
plot.title = element_text(family = "josefin",
face = "bold",
size = 15,
color = '#3B1608',
hjust = 0.5,
vjust = 0.5),
axis.title.x = element_text(family = "josefin",
face = "bold",
size = 18,
angle = 0,
color = '#3B1608',
vjust = 0.8,
hjust = 0.5),
axis.text.x = element_text(family = "josefin",
face = "bold",
color = '#3B1608',
size = 10,
angle = 0,
vjust = 0.5,
hjust = 0.5),
axis.title.y = element_blank(),
axis.text.y = element_blank(),
legend.position = "none",
margin(t = 0,
r = 0,
b = 1,
l = 2),
axis.ticks.y = element_blank(),
panel.border = element_blank(),
axis.line.y = element_blank()
) Code
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## combine dumbbells ----
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- saving subtitlecowplot obj ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Create text grobs for the titles and subtitles
subtitle_grob <- cowplot::ggdraw() + cowplot::draw_text(d_subtitle, x = 0.5, y = 0.5, hjust = 0.5, size = 20, color = '#3B1608')
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- combine dumbbells ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dumb <- small_dumb / med_dumb / big_dumb /bige_dumb +
plot_layout(nrow = 4)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- store in a grid w/ subtitle ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Combine the text panel and the plot stack
final_plot <- plot_grid(
NULL,
subtitle_grob,
dumb,
nrow = 3,
rel_heights = c(0.1, 0.05, 0.75)
) +
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# --- add custom text ----
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include markdown title
ggplot2::labs(title = d_title,
caption = d_caption,
alt = d_alt) +
theme(
plot.title = element_markdown(family = "josefin",
face = "bold",
size = 25,
hjust = 0.2,
vjust = -.5)
)
# Display the final plot
final_plot